package cn.gong.movie.ui;

import java.util.Timer;
import java.util.TimerTask;

import framework.base.BaseAct;
import framework.base.MainService;

import android.content.Intent;
import android.os.Bundle;

public class ActFirst extends BaseAct {

	@Override
	public void onCreateAct(Bundle savedInstanceState) {
		super.onCreateAct(savedInstanceState);
		// 设置布局
		setContentView(R.layout.logo);

		// 启动service
		startService();

		final Timer timer = new Timer();
		timer.schedule(new TimerTask() {

			@Override
			public void run() {
				timer.cancel();
				openAct(ActMain.class);
				animTranslateRightIn();
				finish();
			}
		}, 1000, 1000);

	}

	private void startService() {
		if (!MainService.serviceState) {
			Intent intent = new Intent(this, MainService.class);
			startService(intent);
		}
	}

}
